package tech.topcoder.springcloud.simpleservice.mybatis;

import java.io.Serializable;
import java.util.List;

/**
 * 业务分页类
 * Created by hhj on 16-12-12.
 */
public class Pagination<E> implements Serializable {

    private long total;

    private List<E> data;

    public Pagination(long total, List<E> data) {

        this.total = total;

        this.data = data;

    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public List<E> getData() {
        return data;
    }

    public void setData(List<E> data) {
        this.data = data;
        if (data != null && data.size() > this.total) {
            this.data = null;
        }
    }
}
